Skip to content

Refactoring imageRouter to modularity#771

Merged
SISheogorath merged 1 commit intohackmdio:masterfrom
SISheogorath:refactor/imageRouter
Mar 21, 2018
Merged

Refactoring imageRouter to modularity#771
SISheogorath merged 1 commit intohackmdio:masterfrom
SISheogorath:refactor/imageRouter

Conversation

@SISheogorath
Copy link
Copy Markdown
Contributor

This should make the imageRouter more modular and easier to extent. Also
a lot of code duplication was removed which should simplify maintenance
in future.

In the new setup we only need to provide a new module file which exports
a function called uploadImage and takes a filePath and a callback as
argument. The callback itself takes an error and an url as parameter.
This eliminates the need of a try-catch-block around the statement and
re-enabled the optimization in NodeJS.

@ccoenen
Copy link
Copy Markdown
Contributor

ccoenen commented Mar 18, 2018

nice!

This should make the imageRouter more modular and easier to extent. Also
a lot of code duplication was removed which should simplify maintenance
in future.

In the new setup we only need to provide a new module file which exports
a function called `uploadImage` and takes a filePath and a callback as
argument. The callback itself takes an error and an url as parameter.
This eliminates the need of a try-catch-block around the statement and
re-enabled the optimization in NodeJS.

Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
@SISheogorath SISheogorath merged commit 6485f96 into hackmdio:master Mar 21, 2018
@SISheogorath SISheogorath deleted the refactor/imageRouter branch March 21, 2018 13:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants